package com.ti.demo.tool;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @description: com.ti.demo.tool
 * @Author Triagen
 * @Date 2025/10/9 13:39
 */
public class AlarmTools {

    // 通过 tools 方法解析 AlarmTools 对象 构建工具信息
    @Tool(name = "setAlarm", description = "Set a user alarm for the given time, provided in ISO-8601 format", returnDirect = false)
    void setAlarm(@ToolParam(description = "Time in ISO-8601 format") String time) {
        LocalDateTime alarmTime = LocalDateTime.parse(time, DateTimeFormatter.ISO_DATE_TIME);
        System.out.println("Alarm set for " + alarmTime);
    }
}
